package Demo13;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-20
 * Time: 10:10
 */
import java.util.Scanner;
class TDVector {
    private double x;
    private double y;
    public String toString() {
        return "("+this.x+","+this.y+")";
    }
    TDVector(){

    }
    TDVector(double x,double y){
        this.x = x;
        this.y = y;
    }
    TDVector(TDVector b){
        this.x = b.x;
        this.y = b.y;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }
    public TDVector add(TDVector c){
        TDVector b = new TDVector();
        b.x = this.x + c.x;
        b.y = this.y + c.y;
        return  b;
    }
}

public class Main {
    public static void main(String[] args) {
        TDVector a = new TDVector();  //    default ctor, x and y are zeros
        Scanner sc = new Scanner(System.in);
        double x,y,z;
        x = sc.nextDouble();
        y = sc.nextDouble();
        z = sc.nextDouble();
        TDVector b = new TDVector(x, y);    //  ctor by x and y
        TDVector c = new TDVector(b);       //  ctor by another TDVector
        a.setY(z);
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        c.setX(z);
        a = b.add(c);
        System.out.println(a);
        System.out.println("b.x="+b.getX()+" b.y="+b.getY());
        sc.close();
    }
}